import React, { Component } from 'react';

class Index extends Component {
	state = {
		token: localStorage.getItem('token')
	}
	quit = () => {
		localStorage.removeItem('token')
		this.props.history.push({ pathname: '/login' })
	}
	render() {
		const { token } = this.state
		return (
			<div>
				<h1>{ token }</h1>
				<button onClick={ this.quit }>退出登录</button>
			</div>
		);
	}
}

export default Index;
